
//
//  MyKaQuanTakenPageViewController.m
//  FD
//
//  Created by xiaofang wang on 2018/11/17.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "MyKaQuanTakenPageViewController.h"
#import "YNPageViewController.h" //分页效果

#import "MyKaQuanUsedViewController.h"
#import "MyKaQuanUnusedViewController.h"

@interface MyKaQuanTakenPageViewController ()<YNPageViewControllerDelegate,
YNPageViewControllerDataSource>

@end

@implementation MyKaQuanTakenPageViewController
- (void)viewDidLoad {
    [super viewDidLoad];
}

+ (instancetype)wsorderTopPageVC {
    YNPageConfigration *configration = [YNPageConfigration defaultConfig];
    configration.pageStyle = YNPageStyleTop;
    configration.headerViewCouldScale = YES;
    configration.headerViewScaleMode = YNPageHeaderViewScaleModeTop;
    configration.showTabbar = NO;
    configration.showNavigation = YES;
    configration.scrollMenu = NO;
    configration.aligmentModeCenter = NO;
    configration.lineWidthEqualFontWidth = YES;
    //    configration.showBottomLine = YES;
    configration.lineColor = [UIColor redColor]; //线的颜色
    configration.selectedItemColor = [UIColor blackColor];
    
    MyKaQuanTakenPageViewController *vc = [MyKaQuanTakenPageViewController pageViewControllerWithControllers:[self getArrayVCs] titles:[self getArrayTitles] config:configration];
    
    vc.dataSource = vc;
    vc.delegate = vc;
    
    return vc;
}

+ (NSArray *)getArrayVCs {
    
    MyKaQuanUnusedViewController *vc1 = [[MyKaQuanUnusedViewController alloc] init]; //已使用/失效
    MyKaQuanUsedViewController * vc2 = [[MyKaQuanUsedViewController alloc] init]; //未使用
    
    return @[vc1, vc2];
}

+ (NSArray *)getArrayTitles {
    //国际化
    NSString *wsyStr = NSLocalizedString(NotUse, @"未使用");
    NSString *ysysxStr = NSLocalizedString(AlreadyUse, @"已使用/失效");
    
    return @[wsyStr,ysysxStr];
}

#pragma mark - YNPageViewControllerDataSource
- (UIScrollView *)pageViewController:(YNPageViewController *)pageViewController pageForIndex:(NSInteger)index {
    
    MyKaQuanUnusedViewController *vc = pageViewController.controllersM[index];
    return [vc tableView];
}

@end
